package com.th.admin.actuator.endpoint;

import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.Map;

/**
 * @author ThreePure
 * @date 2022/4/23 21:15
 * @description: TODO
 * @since 1.8
 */
@Component
@Endpoint(id = "aa")
public class MyAAAEndpoint {
    @ReadOperation
    public Map getAaaInfo(){
        return Collections.singletonMap("info","AAA started...");
    }

    @WriteOperation
    private void restartAaa(){
        System.out.println("AAA restarted....");
    }
}
